package com.htc.webservice;

import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.htc.model.dto.WeatherApiDTO;

public class parseWeatherApiModel {
	public static parseWeatherApiModel instance;

	public static parseWeatherApiModel getInstance() {
		if (instance == null)
			instance = new parseWeatherApiModel();
		return instance;
	}

	public static String TAG_QUERY = "query";
	private static String TAG_RESULTS = "results";
	private static String TAG_CHANNEL = "channel";
	private static String TAG_ITEM = "item";
	private static String TAG_CONDITION = "condition";
	private static String TAG_DESCRIPTION = "description";
	private static String TAG_DATE = "date";
	private WeatherApiDTO arrAPI;

	public WeatherApiDTO parseTable(String json) throws JSONException {
		WeatherApiDTO dto = new WeatherApiDTO();

		JSONObject object = new JSONObject(json);
		dto.setWeatherCondition(object.getString(WeatherApiDTO.TAG_CONDITION));

		return dto;
	}
}
